home *** CD-ROM | disk | FTP | other *** search
- Path: solon.com!not-for-mail
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c,comp.lang.c.moderated
- Subject: Re: const pointer confusion...
- Date: 27 Mar 1996 17:57:37 -0600
- Organization: none
- Sender: clc@solutions.solon.com
- Approved: clc@solutions.solon.com
- Message-ID: <4jcklh$9u3@solutions.solon.com>
- References: <4j06gm$7oa@solutions.solon.com> <4j41hs$nku@solutions.solon.com> <4j6354$3ge@solutions.solon.com> <4ja3uf$pe8@solutions.solon.com>
- Reply-To: fred@genesis.demon.co.uk
- NNTP-Posting-Host: solutions.solon.com
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <4ja3uf$pe8@solutions.solon.com>
- c2a192@ugrad.cs.ubc.ca "Kazimir Kylheku" writes:
-
- >In article <4j6354$3ge@solutions.solon.com>,
- >Kurt Watzka <watzka@stat.uni-muenchen.de> wrote:
- > >AFAIK, "const int const *p;" _indeed is_ a syntax error.
- >
- >No. It is a semantic error that some compilers will warn about.
-
- Still wrong! :-)
-
- It is a constraint violation which the compiler must diagnose.
-
- 6.5.3 constraints:
-
- "The same type qualifier shall not appear more than once in the same
- specifier list or qualifier list, either directly or via one or more
- typedefs."
-
- >A the
- >duplicate type qualifier isn't a problem, but it could indicate that the
- >programmer intended to do something else.
- >
- >Your compiler is producing a misleading diagnostic. There is no invalid type
- >combination here. The error is one of a redunant ``const'', which is not
- >forbidden by the C language.
-
- The compiler is correct.
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-